---
title: Deploy Kubernetes Manifests
sidebar_label: Manifests
---

import FragmentKubectlApplyArgs from '../../../_partials/kubectl-options-applyArgs.mdx';
import FragmentKubectlBinaryPath from '../../../_partials/kubectl-options-binaryPath.mdx';
import FragmentKubectlKustomize from '../../../_partials/kubectl-kustomize.mdx';
import FragmentKustomizeKustomizeArgs from '../../../_partials/kustomize-options-kustomizeArgs.mdx';
import FragmentUpdateImageTags from '../../../_partials/kubectl-updateImageTags.mdx';

To deploy Kubernetes manifests with `kubectl apply`, you need to configure them within the `deployments` section of the `devspace.yaml`.


## Example
```yaml title=devspace.yaml
pipelines:
  dev: 
    run: |
      create_deployments backend
      create_deployments frontend
deployments:
  backend:
    kubectl:
      manifests:
      - backend/
      - backend-extra/
  frontend:
    kubectl:
      manifests:
      - frontend/manifest.yaml
```

The above example will be executed during the deployment process as follows:
```bash
kubectl apply -f backend/
kubectl apply -f backend-extra/
kubectl apply -f frontend/manifest.yaml
```


## Update Image Tags

<FragmentUpdateImageTags/>


## `kubectl` Binary
Deployments with `kubectl` require `kubectl` to be installed. If the `kubectl` binary cannot be found within the `$PATH` variable and it is not specified by specifying the [`kubectlBinaryPath` option](./README.mdx#deployments-kubectl-kubectlBinaryPath), DevSpace will download the `kubectl` binary into the `$HOME/.devspace/bin` folder.



## Extra Arguments
When deploying manifests via `kubectl`, DevSpace can pass additional arguments and flags to the `kubectl` commands used for the deployment process.

### Args For `kubectl create`
The `createArgs` option expects an array of strings stating additional arguments (and flags) that should be used when calling `kubectl create`.

#### Example: Custom Kubectl Args & Flags
```yaml
deployments:
  backend:
    kubectl:
      manifests:
      - backend/
      createArgs:
      - "--recursive"
```
**Explanation:**  
Deploying the above example would roughly be equivalent to this command:
```bash
kubectl create --dry-run --output yaml --validate=false --recursive -f backend/
```


### Args For `kubectl apply`

<FragmentKubectlApplyArgs/>
